package domain;
//购物车类，对应一张购物车表，购物车表里面有所有用户的 添加到购物车的商品和他们对应的ID

/*CREATE TABLE Cart (
    CartID INT AUTO_INCREMENT PRIMARY KEY, -- 每条购物记录
    ProductID INT NOT NULL,
    ProductName VARCHAR(255) NOT NULL, -- 商品名称，不允许为空
    RetailPrice DECIMAL(10, 2) NOT NULL, -- 零售价格，假设最多10位数字，其中2位是小数
    MyQuantity INT NOT NULL, -- 添加到购物车的数量
    Model VARCHAR(255) NOT NULL, -- 型号，不允许为空
    ClientID INT NOT NULL -- 客户ID
);*/
public class Cart {
    private Integer cartID;
    private Integer productID;
    private String productName;
    private Double retailPrice;
    private Integer myQuantity;
    private String model;
    private Integer clientID;
    public Cart() {
    }


    @Override
    public String toString() {

        return String.format("\t\t%-10d %-15s %-10.2f %-10d %-10s",
                productID, productName, retailPrice, myQuantity, model);
    }

    public Integer getCartID() {
        return cartID;
    }

    public void setCartID(Integer cartID) {
        this.cartID = cartID;
    }

    public Integer getProductID() {
        return productID;
    }

    public void setProductID(Integer productID) {
        this.productID = productID;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Double getRetailPrice() {
        return retailPrice;
    }

    public void setRetailPrice(Double retailPrice) {
        this.retailPrice = retailPrice;
    }

    public Integer getMyQuantity() {
        return myQuantity;
    }

    public void setMyQuantity(Integer myQuantity) {
        this.myQuantity = myQuantity;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public Integer getClientID() {
        return clientID;
    }

    public void setClientID(Integer clientID) {
        this.clientID = clientID;
    }

    public Cart(Integer cartID, Integer productID, String productName, Double retailPrice,
                Integer myQuantity, String model, Integer clientID) {
        this.cartID = cartID;
        this.productID = productID;
        this.productName = productName;
        this.retailPrice = retailPrice;
        this.myQuantity = myQuantity;
        this.model = model;
        this.clientID = clientID;
    }
}
